package com.wisemoresystem.seal.util.abchinaFinger.common;

import java.io.IOException;
import java.util.Properties;

public class AbcCoreCfg {
	public String getServer() {
		return server;
	}

	public void setServer(String server) {
		this.server = server;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getServicename() {
		return servicename;
	}

	public void setServicename(String servicename) {
		this.servicename = servicename;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public String getProgram() {
		return program;
	}

	public void setProgram(String program) {
		this.program = program;
	}

	public String getTranid() {
		return tranid;
	}

	public void setTranid(String tranid) {
		this.tranid = tranid;
	}

	public String getTerm() {
		return term;
	}

	public void setTerm(String term) {
		this.term = term;
	}

	public String getTeller() {
		return teller;
	}

	public void setTeller(String teller) {
		this.teller = teller;
	}

	public String getAbc_type() {
		return abc_type;
	}

	private String abc_type = "";
	private String srv = "";
	private String server = "";
	private String port = "";
	private String servicename = "";
	private String user = "";
	private String pass = "";
	private String program = "";
	private String tranid = "CPMI";
	private String term = "";
	private String teller = "";
	private Properties prop = null;

	public AbcCoreCfg(String Srv) {
		srv = Srv;
		prop = new Properties();
		try {

			prop.load(getClass().getClassLoader().getResourceAsStream(
					"config/AbcCore.properties"));
			abc_type = prop.getProperty("ABC.type");
			server = prop.getProperty("server", "127.0.0.1");
			port = prop.getProperty("port", "2006");
			servicename = prop.getProperty(Srv + ".services");
			user = prop.getProperty(Srv + ".username");
			pass = prop.getProperty(Srv + ".password");
			program = prop.getProperty(Srv + ".progname");
			tranid = prop.getProperty(Srv + ".tranid", "CPMI");
			term = prop.getProperty(Srv + ".term");
			teller = prop.getProperty(Srv + ".teller");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public String toString() {
		return " Srv      : " + srv + "\n Server   : " + server
				+ "\n Port     : " + port + "\n Service  : " + servicename
				+ "\n User     : " + user + "\n Password : " + pass
				+ "\n Progname : " + program + "\n tranid   : " + tranid
				+ "\n term     : " + term + "\n teller   : " + teller + "\n";
	}
}
